package com.ruoyi.an.service.impl;

import java.util.List;

import com.ruoyi.an.domain.AnWechatUserMechanism;
import com.ruoyi.an.mapper.AnWechatUserMechanismMapper;
import com.ruoyi.an.service.IAnWechatUserMechanismService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 机构推广用户列Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-11-05
 */
@Service
public class AnWechatUserMechanismServiceImpl implements IAnWechatUserMechanismService
{
    @Autowired
    private AnWechatUserMechanismMapper anWechatUserMechanismMapper;

    /**
     * 查询机构推广用户列
     * 
     * @param mechanismMemberUserId 机构推广用户列主键
     * @return 机构推广用户列
     */
    @Override
    public AnWechatUserMechanism selectAnWechatUserMechanismByMechanismMemberUserId(Long mechanismMemberUserId)
    {
        return anWechatUserMechanismMapper.selectAnWechatUserMechanismByMechanismMemberUserId(mechanismMemberUserId);
    }

    /**
     * 查询机构推广用户列列表
     * 
     * @param anWechatUserMechanism 机构推广用户列
     * @return 机构推广用户列
     */
    @Override
    public List<AnWechatUserMechanism> selectAnWechatUserMechanismList(AnWechatUserMechanism anWechatUserMechanism)
    {
        return anWechatUserMechanismMapper.selectAnWechatUserMechanismList(anWechatUserMechanism);
    }

    /**
     * 新增机构推广用户列
     * 
     * @param anWechatUserMechanism 机构推广用户列
     * @return 结果
     */
    @Override
    public int insertAnWechatUserMechanism(AnWechatUserMechanism anWechatUserMechanism)
    {
        anWechatUserMechanism.setCreateTime(DateUtils.getNowDate());
        return anWechatUserMechanismMapper.insertAnWechatUserMechanism(anWechatUserMechanism);
    }

    /**
     * 修改机构推广用户列
     * 
     * @param anWechatUserMechanism 机构推广用户列
     * @return 结果
     */
    @Override
    public int updateAnWechatUserMechanism(AnWechatUserMechanism anWechatUserMechanism)
    {
        anWechatUserMechanism.setUpdateTime(DateUtils.getNowDate());
        return anWechatUserMechanismMapper.updateAnWechatUserMechanism(anWechatUserMechanism);
    }

    /**
     * 批量删除机构推广用户列
     * 
     * @param mechanismMemberUserIds 需要删除的机构推广用户列主键
     * @return 结果
     */
    @Override
    public int deleteAnWechatUserMechanismByMechanismMemberUserIds(Long[] mechanismMemberUserIds)
    {
        return anWechatUserMechanismMapper.deleteAnWechatUserMechanismByMechanismMemberUserIds(mechanismMemberUserIds);
    }

    /**
     * 删除机构推广用户列信息
     * 
     * @param mechanismMemberUserId 机构推广用户列主键
     * @return 结果
     */
    @Override
    public int deleteAnWechatUserMechanismByMechanismMemberUserId(Long mechanismMemberUserId)
    {
        return anWechatUserMechanismMapper.deleteAnWechatUserMechanismByMechanismMemberUserId(mechanismMemberUserId);
    }

    @Override
    public List<AnWechatUserMechanism> selectWechatUserMechanismByWechatUserIds(List<Long> wechatUserIds) {
        return anWechatUserMechanismMapper.selectWechatUserMechanismByWechatUserIds(wechatUserIds);
    }
}
